/*
 * TagInt.h
 *
 *  Created on: 18 juin 2011
 *      Author: Pierrick Caillon <pierrick@megami.fr>
 */

#ifndef TAGINT_H_
#define TAGINT_H_

#include "NamedTag.h"
#include "NumericValueTag.h"
#include <sys/types.h>

namespace NamedBinaryTag
{

class __attribute__((visibility("default"))) TagInt: public NamedBinaryTag::NamedTag,
		public NamedBinaryTag::NumericValueTag<sizeof(int32_t)>
{
private:
	int32_t value;
public:
	TagInt();
	virtual ~TagInt();

	TagTypes get_TagType() const;

	void Read(std::istream &input, bool ignoreName);
	void Write(std::ostream &output, bool ignoreName) const;

	int32_t get_Value() const;
	void set_Value(int32_t value);

	ITag *clone() const;
protected:
	TagInt(void *root) : NamedTag(root) {}
	ITag *clone(void *newRoot) const;
};

}

#endif /* TAGINT_H_ */
